package top.eggcode.common.auth;

import org.apache.shiro.SecurityUtils;

/**
 * Title:
 * Description: TODO
 * Date: 2021/7/18 2:22
 *
 * @author JiaQi Ding
 * @version 1.0
 */
public class SecurityUtil {

    public static String getUsername() {
        if (SecurityUtils.getSubject().getPrincipal() == null) {
            return "";
        }
        return SecurityUtils.getSubject().getPrincipal().toString();
    }
}
